<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:p="http://primefaces.org/ui"
	xmlns:hmrList="http://java.sun.com/jsf/composite/list" 
	xmlns:hmrDetail="http://java.sun.com/jsf/composite/detail"	
	xmlns:cc="http://java.sun.com/jsf/composite">

<cc:interface >
	<cc:attribute name="handler" 			type="com.hemerasolutions.v2trainer.component.interfaces.detail.StepCompInterface" required="true" />
	<cc:attribute name="stepType" 			type="java.lang.Integer" required="false" default="0"  />
	<cc:attribute name="removable" 			type="java.lang.Boolean" required="false" default="true"  />
	<cc:attribute name="editable"			type="java.lang.Boolean" required="false" default="true" />
	<cc:attribute name="onImzPopUp"			type="java.lang.String"  required="false" default=""/>
	<cc:attribute name="onIzPopUp"			type="java.lang.String"  required="false" default=""/>
	<cc:facet 	  name="subSteps"			/>
</cc:interface>


<cc:implementation>
	<span id="#{cc.clientId}">
	  	<p:panel id="stepPanel"  collapsed="#{cc.attrs.handler.step.mark || cc.attrs.handler.step.type == 4 }"  rendered="#{cc.attrs.handler.step != null}"
	  		styleClass="ui-step-panel stepstyle#{cc.attrs.handler.step.type == 2 ? cc.attrs.handler.step.templateExercise.variation : cc.attrs.handler.step.type }">
	 		<f:facet name="header">	
				<div  style="width:100%;height:100%;margin:0px;">
					<span style="vertical-align: -webkit-baseline-middle;">
						<c:if test="#{cc.attrs.stepType != 4 and cc.attrs.stepType  != 3}">

							<p:inputText 		value="#{cc.attrs.handler.step.repetition}"  type="number"	size="1" maxlength="3" 	style="vertical-align:top;width:35px"
								disabled="#{!cc.attrs.editable}"   >
								<p:ajax event="blur" 	listener="#{cc.attrs.handler.changeStep}"	 update="@(.ui-trainingStatistics)" />
							</p:inputText>
		
							<h:outputText value=" x  "/>
						</c:if>	
	
<!--Exercise Step ini -->

						<c:if test="#{cc.attrs.stepType == 1}">
							
							<p:inputText value="#{cc.attrs.handler.step.exerciseStep.value }" type="number" 	style="vertical-align:top;width:35px" disabled="#{!cc.attrs.editable}"
								rendered="#{cc.attrs.handler.step.exerciseStep.volumeFactor  != null and not cc.attrs.handler.step.exerciseStep.volumeFactor.timeBased}" >
								<f:attribute name="pattern"	value="#{cc.attrs.handler.step.exerciseStep.volumeFactor.pattern}" 	 	/>
								<p:ajax event="blur" 		listener="#{cc.attrs.handler.changeStep}"	 update="@(.ui-trainingStatistics)"/>
							</p:inputText>
					
							<p:calendar value="#{cc.attrs.handler.step.exerciseStep.dateValue}"	timeZone="GMT0" 	pattern="HH:mm:ss"	locale="pt" disabled="#{!cc.attrs.editable}"
								timeOnly="true" 	rendered="#{cc.attrs.handler.step.exerciseStep.volumeFactor.timeBased}"	style="vertical-align:top;width:4.5em!important"  styleClass="ui-table-calendar">
								<p:ajax event="dateSelect" 	listener="#{cc.attrs.handler.changeStep}"  update="@(.ui-trainingStatistics)"/>
							</p:calendar>					
							
							<h:outputText value=" - #{cc.attrs.handler.step.exerciseStep.volumeFactor.unit} > "	 		rendered="#{cc.attrs.handler.step.type == 1 and cc.attrs.handler.step.exerciseStep.volumeFactor  != null}"/>
					
							<p:selectOneMenu  value="#{cc.attrs.handler.step.exerciseStep.intensityZone}" converter="#{genericConverter}" disabled="#{!cc.attrs.editable}" 
								style="min-width:80px" rendered="#{cc.attrs.handler.step.exerciseStep.execution  != null}" > 
								<f:selectItem itemLabel="#{msgs.Select}" itemValue="#{null}" noSelectionOption="true"/>
					            <f:selectItems value="#{cc.attrs.handler.exerciseIntensityZones}"  var="intensityZone" itemLabel="#{intensityZone.name} " itemValue="#{intensityZone}" />
								<p:ajax  event="change" listener="#{cc.attrs.handler.changeStep}"	 update="stepPanel, @(.ui-trainingStatistics)"/>
							</p:selectOneMenu>
					
							<h:outputText value=" > #{cc.attrs.handler.step.exerciseStep.exercise.name }"/>
	
						</c:if>
	
		
	<!--Exercise Step end -->
								
	<!--Template Exercise ini	 -->
						<c:if test="#{cc.attrs.stepType == 2}">
	
							<p:inputText value="#{cc.attrs.handler.step.templateExercise.value }" 	type="number" style="vertical-align:top;width:30px" disabled="#{!cc.attrs.editable}"
								rendered="#{cc.attrs.handler.step.templateExercise.volumeFactor  != null and not cc.attrs.handler.step.templateExercise.volumeFactor.timeBased}" >
								<f:converter converterId="dynamicNumberConverter" />
								<f:attribute name="pattern"	value="#{cc.attrs.handler.step.templateExercise.volumeFactor.pattern}" 	 	/>
								<p:ajax event="blur" 	listener="#{cc.attrs.handler.changeStep}"	 update="@(.ui-trainingStatistics)"/>
							</p:inputText>
							
							<p:calendar value="#{cc.attrs.handler.step.templateExercise.dateValue}"	timeZone="GMT0" pattern="HH:mm:ss"	locale="pt" disabled="#{!cc.attrs.editable}"
								timeOnly="true" 	rendered="#{cc.attrs.handler.step.templateExercise.volumeFactor.timeBased}"	style="vertical-align:top;width:4.5em!important"  styleClass="ui-table-calendar">
								<p:ajax event="dateSelect" 	listener="#{cc.attrs.handler.changeStep}"	update="@(.ui-trainingStatistics)}"/>
							</p:calendar>
					
							<h:outputText value=" - #{cc.attrs.handler.step.templateExercise.volumeFactor.unit}"	 	rendered="#{cc.attrs.handler.step.type == 2 and cc.attrs.handler.step.templateExercise.volumeFactor  != null}"/>
					
							<h:outputText value=" > #{msgs[cc.attrs.handler.step.templateExercise.trainingType.name] }" 	rendered="#{cc.attrs.handler.step.type == 2 and cc.attrs.handler.step.templateExercise.trainingType.name != null}"/>
							<h:outputText value=" > #{cc.attrs.handler.step.templateExercise.modality.name }" 			rendered="#{cc.attrs.handler.step.type == 2 and cc.attrs.handler.step.templateExercise.modality.name != null}"/>
					
							<h:outputText value=" >" 	rendered="#{cc.attrs.handler.step.templateExercise.volumeFactor  != null}"/>
					
							<p:selectOneMenu value="#{cc.attrs.handler.step.templateExercise.intensityModZone}" converter="#{genericConverter}" style="min-width:100px" disabled="#{!cc.attrs.editable}"
								rendered="#{cc.attrs.handler.step.templateExercise.execution != null and cc.attrs.handler.step.templateExercise.execution  != null}" >
								<f:selectItem itemLabel="#{msgs.Select}" itemValue="#{null}" noSelectionOption="true"/>
					           	<f:selectItems value="#{cc.attrs.handler.templateIntensityModZones}"  var="intensityModZone" itemLabel="#{intensityModZone.name} " itemValue="#{intensityModZone}" />
								<p:ajax  event="change"		listener="#{cc.attrs.handler.changeStep}"	 update="stepPanel, @(.ui-trainingStatistics)"/>
							</p:selectOneMenu>
					
							<h:outputText value=" > #{msgs.Variation} > " rendered="#{cc.attrs.handler.step.type == 2}" />
							<p:selectOneMenu id="variationSelectOne" value="#{cc.attrs.handler.step.templateExercise.variation}"  style="min-width:80px" disabled="#{!cc.attrs.editable}"  >
								<f:selectItem itemLabel="#{msgs.Select}" itemValue="#{null}" noSelectionOption="true" />
								<f:selectItems value="#{cc.attrs.handler.variations}"  var="letter" itemLabel="#{letter}" itemValue="#{letter}"/> 
								<p:ajax  event="change"	 listener="#{cc.attrs.handler.changeStep}"	update=" stepPanel, @(.ui-trainingStatistics)"/>
							</p:selectOneMenu> 	
						</c:if>
	<!--Template Exercise end -->
		
	<!-- Grouped Step ini -->
						<c:if test="#{cc.attrs.stepType == 3}">
							<h:outputText value="!" title="#{msgs.IntensityModZoneAndIntensityZoneIcompatible}" 
								styleClass="ui-state-error" rendered="#{cc.attrs.handler.step.exerciseGroupedStep.intensityZone == null}"/>
					
							<h:outputText value="#{cc.attrs.handler.step.exerciseGroupedStep.exercise.name}" />
						</c:if>
		
	<!-- Grouped Step end -->
	<!-- Rest Step ini -->
						<c:if test="#{cc.attrs.stepType == 4}">
							<p:calendar label="#{msgs.Rest}: " value="#{cc.attrs.handler.step.restInterval}"	timeZone="GMT0" 	pattern="HH:mm:ss" locale="pt" 
								 timeOnly="true"  disabled="#{!cc.attrs.editable}" styleClass="ui-table-calendar" style="display:top" >
								<p:ajax event="dateSelect" 	listener="#{cc.attrs.handler.changeStep}"	update=" restinterval, @(.ui-trainingStatistics)"  />
								<p:ajax event="blur" 		listener="#{cc.attrs.handler.changeStep}"	update=" restinterval, @(.ui-trainingStatistics)"  />
							</p:calendar>
					
							<h:outputText value="#{msgs.Rest}" 	style="margin-left:5px;margin-right:5px" 		/> 
							<h:outputText id="restinterval" value="#{cc.attrs.handler.step.intervalToString}" 	/>
						</c:if>

	<!-- Rest Step end -->
	<!-- Group Step ini -->
						<c:if test="#{cc.attrs.stepType == 5}">
							<p:inputText value="#{cc.attrs.handler.step.exerciseGroupStep.value }" type="number" 	disabled="#{!cc.attrs.editable}" style="vertical-align:top;width:35px" 
								rendered="#{cc.attrs.handler.step.exerciseGroupStep.volumeFactor  != null and not cc.attrs.handler.step.exerciseGroupStep.volumeFactor.timeBased}" >
								<f:converter converterId="dynamicNumberConverter" />
								<f:attribute name="pattern"	value="#{cc.attrs.handler.step.exerciseGroupStep.volumeFactor.pattern}" 	 	/>
								<p:ajax event="blur" 		listener="#{cc.attrs.handler.changeStep}" 	update="@(.ui-trainingStatistics)"/>
							</p:inputText>
					
							<p:calendar value="#{cc.attrs.handler.step.exerciseGroupStep.dateValue}"	timeZone="GMT0" 	pattern="HH:mm:ss"	locale="pt" disabled="#{!cc.attrs.editable}"
								timeOnly="true" 	rendered="#{cc.attrs.handler.step.exerciseGroupStep.volumeFactor.timeBased}"	style="vertical-align:top;width:4.5em!important"  styleClass="ui-table-calendar">
								<p:ajax event="dateSelect" 	listener="#{cc.attrs.handler.changeStep}"	update="@(.ui-trainingStatistics)"/>
							</p:calendar>					
							
							<h:outputText value=" - #{cc.attrs.handler.step.exerciseGroupStep.volumeFactor.unit} > "	 		rendered="#{cc.attrs.handler.step.exerciseGroupStep.volumeFactor  != null}"/>
					
							<p:selectOneMenu  value="#{cc.attrs.handler.step.exerciseGroupStep.intensityModZone}" converter="#{genericConverter}" disabled="#{!cc.attrs.editable}"
								style="min-width:80px" rendered="#{cc.attrs.handler.step.exerciseGroupStep.execution  != null}" > 
								<f:selectItem itemLabel="#{msgs.Select}" itemValue="#{null}" noSelectionOption="true"/>
					            <f:selectItems value="#{cc.attrs.handler.egIntensityModZones}"  var="intensityModZone" itemLabel="#{intensityModZone.name} " itemValue="#{intensityModZone}" />
								<p:ajax  event="change"	 listener="#{cc.attrs.handler.changeEgImz}" update="stepPanel, @(.ui-trainingStatistics)"/>
							</p:selectOneMenu>
	
							<p:selectOneMenu value="#{cc.attrs.handler.step.exerciseGroupStep.execution}" converter="#{genericConverter}" 
								style="min-width:100px" disabled="#{!cc.attrs.editable}" >
								<f:selectItem itemLabel="#{msgs.Select}" itemValue="#{null}" noSelectionOption="true" />
					           	<f:selectItems value="#{cc.attrs.handler.egExecutions}"  var="execution" itemLabel="#{msgs[execution.name]}" itemValue="#{execution}" />
								<p:ajax 	listener="#{cc.attrs.handler.changeEgExecution}"  	update="stepPanel, @(.ui-trainingStatistics)"  />
							</p:selectOneMenu>
					
							<p:selectOneMenu value="#{cc.attrs.handler.step.exerciseGroupStep.volumeType}"  converter="#{genericConverter}"  style="min-width:100px" 
								disabled="#{!cc.attrs.editable}" > 
								<f:selectItem itemLabel="#{msgs.Select}" itemValue="#{null}" noSelectionOption="true"/>
					           	<f:selectItems value="#{cc.attrs.handler.egVolumeTypes}"  var="volumeType" itemLabel="#{msgs[volumeType.name]} " itemValue="#{volumeType}" />
								<p:ajax listener="#{cc.attrs.handler.changeEgVolumeType}" 		update="stepPanel, @(.ui-trainingStatistics)" />
							</p:selectOneMenu>
					
							<p:selectOneMenu value="#{cc.attrs.handler.step.exerciseGroupStep.volumeFactor}"  converter="#{genericConverter}"  style="min-width:80px" disabled="#{!cc.attrs.editable}"
								rendered="#{ cc.attrs.handler.step.exerciseGroupStep.volumeType != null and fn:length(cc.attrs.handler.egVolumeFactors) > 1 }" >
								<f:selectItem itemLabel="#{msgs.Select}" itemValue="#{null}" noSelectionOption="true"/>
					           	<f:selectItems value="#{cc.attrs.handler.egVolumeFactors}"  var="volumeFactor" itemLabel="#{msgs[volumeFactor.name]} " itemValue="#{volumeFactor}" />
								<p:ajax 	listener="#{cc.attrs.handler.changeStep}" update="stepPanel, @(.ui-trainingStatistics)" />
							</p:selectOneMenu>
					
							<h:outputText value=" - #{msgs.Group} > #{cc.attrs.handler.step.name}" />
						</c:if>

	<!-- Group Step end -->
	<!-- Groups and  series	ini -->
						<c:if test="#{cc.attrs.stepType >=6}">
							<h:outputText 	value="#{msgs.Series}"	style="margin-left:10px" 	rendered="#{cc.attrs.handler.step.type == 6}" /> 
							<h:outputText 	value="#{cc.attrs.handler.step.name}" 				rendered="#{cc.attrs.handler.step.type >= 7}"/> 
	<!-- Groups and  series	end -->
						</c:if>

			  			<p:commandButton styleClass="ui-icon-only ui-button-header " icon="ui-icon-help" actionListener="#{cc.attrs.handler.toViewIz}" update="@(.ui-intensityZoneList)"
			  				rendered="#{cc.attrs.handler.step.type == 1 or cc.attrs.handler.step.type == 3}"	
			  				oncomplete="#{cc.attrs.onIzPopUp}" style="float:none;vertical-align: top;margin-left:5px;margin-right:5px" 	onkeypress="if( event.keyCode == 13){event.keyCode=0;}" />

			  			<p:commandButton styleClass="ui-icon-only ui-button-header " icon="ui-icon-help" actionListener="#{cc.attrs.handler.toViewImz}" update="@(.ui-modalityIZList)"
			  				rendered="#{cc.attrs.handler.step.type == 5 or cc.attrs.handler.step.type == 2}"	
			  				oncomplete="#{cc.attrs.onImzPopUp}" style="float:none;vertical-align: top;margin-left:5px;margin-right:5px" 	onkeypress="if( event.keyCode == 13){event.keyCode=0;}" />

				  		<p:commandButton actionListener="#{cc.attrs.handler.deleteStep }"   update="@form"   icon="ui-icon-trash" 
				  			styleClass="ui-panel-titlebar-icon ui-button-header" 			onkeypress="if( event.keyCode == 13){event.keyCode=0;}"  disabled="#{!cc.attrs.editable}">
				        	<f:attribute name="step" value="#{cc.attrs.handler.step}"/>         	 
				        </p:commandButton> 	 			
				
						<p:commandButton actionListener="#{cc.attrs.handler.toggleStep}"	update="stepPanel:@parent:@parent:@parent, @(.ui-trainingStatistics)" 
							icon="#{cc.attrs.handler.step.mark? 'ui-icon-plusthick' : 'ui-icon-minusthick'}" 	onkeypress="if( event.keyCode == 13){event.keyCode=0;}"  
							styleClass="ui-panel-titlebar-icon ui-button-header" rendered="#{cc.attrs.handler.step.type != 4 and cc.attrs.handler.step.type != 3}" /> 
				
						<p:outputPanel layout="block" style="float:right;vertical-align: -webkit-baseline-middle;" rendered="#{cc.attrs.handler.step.type != 4}" >
							<h:outputText value="#{msgs.Rest}: " style="vertical-align: -webkit-baseline-middle;"/>
				
							<p:calendar label="#{msgs.Rest}: " value="#{cc.attrs.handler.step.restInterval}"	timeZone="GMT0" 	pattern="HH:mm:ss" locale="pt" 
								 timeOnly="true"  disabled="#{!cc.attrs.editable}" styleClass="ui-table-calendar" style="display:top" >
								<p:ajax event="dateSelect"	listener="#{cc.attrs.handler.changeStep}" update="@(.ui-trainingStatistics)"  />
								<p:ajax event="blur"		listener="#{cc.attrs.handler.changeStep}" update="@(.ui-trainingStatistics)"  />
							</p:calendar>
						</p:outputPanel>
					</span>
				</div>
				
				
	 		</f:facet>

	 		<h:outputText value="#{cc.attrs.level}" 					style="display:none" styleClass="ui-step-level" />
	  		<h:outputText value="#{cc.attrs.handler.step.uuid}" 		style="display:none" styleClass="ui-step-uuid" />
	
			<c:if test="#{cc.attrs.stepType ==2}">
				<h:panelGrid rendered="#{cc.attrs.handler.step.type == 2}" columns="4"  >
			
			
					<h:outputText value="#{msgs.ModalityType}" style="white-space: nowrap;"/>
					<p:selectOneMenu id="modalityTypeSelectOne" value="#{cc.attrs.handler.step.templateExercise.trainingType}" disabled="#{cc.attrs.handler.step.type == 0 and !cc.attrs.editable}"  
						converter="#{genericConverter}" style="min-width:100px" >
						<f:selectItem itemLabel="#{msgs.Select}" itemValue="#{null}" noSelectionOption="true"/>
		            	<f:selectItems value="#{cc.attrs.handler.templateTrainingTypes}"  var="trainingType" itemLabel="#{msgs[trainingType.name]}" itemValue="#{trainingType}" />
						<p:ajax listener="#{cc.attrs.handler.changeTemplateTrainingType}" 	 update="stepPanel, @(.ui-trainingStatistics)"/>
					</p:selectOneMenu>
		
					<h:outputText  value="#{msgs.Modality}" rendered="#{cc.attrs.handler.step.templateExercise.trainingType != null}"  />
					<p:selectOneMenu id="modalitySelectOne" value="#{cc.attrs.handler.step.templateExercise.modality}"  	disabled="#{cc.attrs.handler.step.type == 0  and !cc.attrs.editable}"  
						converter="#{genericConverter}" style="min-width:100px"		rendered="#{cc.attrs.handler.step.templateExercise.trainingType != null}" >
						<f:selectItem itemLabel="#{msgs.Select}" itemValue="#{null}" noSelectionOption="true"/>
		            	<f:selectItems value="#{cc.attrs.handler.templateModalitys}"  var="modality" itemLabel="#{modality.name}" itemValue="#{modality}" />
						<p:ajax listener="#{cc.attrs.handler.changeTemplateModality}"		 update="stepPanel, @(.ui-trainingStatistics)"  />
					</p:selectOneMenu>
					
		
					<h:outputText  value="#{msgs.Execution}" rendered="#{cc.attrs.handler.step.templateExercise.modality != null}" />
					<p:selectOneMenu id="executionTypeSelectOne" value="#{cc.attrs.handler.step.templateExercise.execution}" converter="#{genericConverter}" style="min-width:100px"
						rendered="#{cc.attrs.handler.step.templateExercise.modality != null}"   disabled="#{!cc.attrs.editable}" >
						<f:selectItem itemLabel="#{msgs.Select}" itemValue="#{null}" noSelectionOption="true"/>
		            	<f:selectItems value="#{cc.attrs.handler.templateExecutions}"  var="execution" itemLabel="#{msgs[execution.name]}" itemValue="#{execution}" />
						<p:ajax 	listener="#{cc.attrs.handler.changeTemplateExecution}"   update="stepPanel, @(.ui-trainingStatistics)"  />
					</p:selectOneMenu>
		
					<h:outputText  value="#{msgs.VolumeType}" rendered="#{cc.attrs.handler.step.templateExercise.modality != null}" /> 
					<p:selectOneMenu id="volumeTypeSelectOne" value="#{cc.attrs.handler.step.templateExercise.volumeType}"  converter="#{genericConverter}"  style="min-width:100px"
						rendered="#{cc.attrs.handler.step.templateExercise.modality != null}" disabled="#{!cc.attrs.editable}" >
						<f:selectItem itemLabel="#{msgs.Select}" itemValue="#{null}" noSelectionOption="true"/>
		            	<f:selectItems value="#{cc.attrs.handler.templateVolumeTypes}"  var="volumeType" itemLabel="#{msgs[volumeType.name]} " itemValue="#{volumeType}" />
						<p:ajax listener="#{cc.attrs.handler.changeVolumeType}"  update="stepPanel, @(.ui-trainingStatistics)" />
					</p:selectOneMenu>
		
					<h:outputText  value="#{msgs.VolumeUnit}" rendered="#{cc.attrs.handler.step.templateExercise.volumeType != null and fn:length(cc.attrs.handler.templateVolumeFactors) > 1}" />
					<p:selectOneMenu id="volumeFactorSelectOne" value="#{cc.attrs.handler.step.templateExercise.volumeFactor}"  converter="#{genericConverter}"  style="min-width:80px"
						rendered="#{cc.attrs.handler.step.templateExercise.volumeType != null and fn:length(cc.attrs.handler.templateVolumeFactors) > 1 }" >
						<f:selectItem itemLabel="#{msgs.Select}" itemValue="#{null}" noSelectionOption="true"/>
		            	<f:selectItems value="#{cc.attrs.handler.templateVolumeFactors}"  var="volumeFactor" itemLabel="#{msgs[volumeFactor.name]} " itemValue="#{volumeFactor}" />
						<p:ajax 	listener="#{cc.attrs.handler.changeStep}" update="stepPanel, @(.ui-trainingStatistics)" />
					</p:selectOneMenu>
		
	
				</h:panelGrid>
			</c:if>	
			<c:if test="#{cc.attrs.stepType == 1}">
				<h:panelGrid rendered="#{cc.attrs.handler.step.type == 1 }" columns="4" >
					<h:outputText  value="#{msgs.Execution}" />
					<p:selectOneMenu  value="#{cc.attrs.handler.step.exerciseStep.execution}"  converter="#{genericConverter}"  style="min-width:100px" disabled="#{!cc.attrs.editable}"  >
						<f:selectItem itemLabel="#{msgs.Select}" itemValue="#{null}" noSelectionOption="true"/>
				        <f:selectItems value="#{cc.attrs.handler.step.exerciseStep.exercise.executions}"  var="execution" itemLabel="#{msgs[execution.name]}" itemValue="#{execution}" />
						<p:ajax 	listener="#{cc.attrs.handler.changeExerciseExecution}"   update="stepPanel, @(.ui-trainingStatistics)"  />
					</p:selectOneMenu>
		
					<h:outputText  value="#{msgs.VolumeType}" /> 
					<p:selectOneMenu  value="#{cc.attrs.handler.step.exerciseStep.volumeType}" converter="#{genericConverter}"  style="min-width:100px"  disabled="#{!cc.attrs.editable}">
						<f:selectItem itemLabel="#{msgs.Select}" itemValue="#{null}" noSelectionOption="true"/>
			            	<f:selectItems value="#{cc.attrs.handler.exerciseVolumeTypes}"  var="volumeType" itemLabel="#{msgs[volumeType.name]} " itemValue="#{volumeType}" />
						<p:ajax listener="#{cc.attrs.handler.changeExerciseVolumeType}"  update="stepPanel, @(.ui-trainingStatistics)" />
					</p:selectOneMenu>
		
					<h:outputText  value="#{msgs.VolumeUnit}" rendered="#{fn:length(cc.attrs.handler.exerciseVolumeFactors) > 1}" />
					<p:selectOneMenu value="#{cc.attrs.handler.step.exerciseStep.volumeFactor}" converter="#{genericConverter}" disabled="#{!cc.attrs.editable}"
						rendered="#{fn:length(cc.attrs.handler.exerciseVolumeFactors) > 1}"	style="min-width:80px"    >
						<f:selectItem itemLabel="#{msgs.Select}" itemValue="#{null}" noSelectionOption="true"/>
		            	<f:selectItems value="#{cc.attrs.handler.exerciseVolumeFactors}"  var="volumeFactor" itemLabel="#{msgs[volumeFactor.name]} " itemValue="#{volumeFactor}" />
						<p:ajax	listener="#{cc.attrs.handler.changeStep}"  update="stepPanel, @(.ui-trainingStatistics)" />
					</p:selectOneMenu>
	
				</h:panelGrid>
			</c:if>	
			
			<c:if test="#{cc.attrs.stepType >=5}">		
				<h:panelGrid id="steptable" styleClass="ui-sortable-custom">
					<h:column>
						<c:forEach  items="#{cc.attrs.handler.step.steps}"  var="step" varStatus="loop"   >
							<p:outputPanel id="step#{step.uuid}" layout="block" styleClass="ui-stepPanel">
								<hmrDetail:stepComp handler="#{cc.attrs.handler.parentPanelHandler.stepHandlers[step.uuid]}"	
									stepType="#{step.type}" editable="#{cc.attrs.editable}"	onIzPopUp="#{cc.attrs.onIzPopUp}"	onImzPopUp="#{cc.attrs.onImzPopUp}"    /> 
							</p:outputPanel>							
						</c:forEach>				
					</h:column>		
				</h:panelGrid>			
			</c:if>
		</p:panel>
	</span>	
</cc:implementation>
</html>